﻿using Newtonsoft.Json;
using System;
using System.ComponentModel.DataAnnotations.Schema;
using YiSha.Util;

namespace YiSha.Entity.SystemManage
{
    /// <summary>
    ///定时任务表
    /// </summary>
    [Table("SysAutoJob")]
    public class AutoJobEntity : BaseExtensionEntity
    {
        /// <summary>
        /// 任务分组名称
        /// </summary>
        /// <returns></returns>
        public string JobGroupName { get; set; }

        /// <summary>
        /// 任务名称
        /// </summary>
        /// <returns></returns>
        public string JobName { get; set; }

        /// <summary>
        /// 任务状态
        /// </summary>
        /// <returns></returns>
        public int? JobStatus { get; set; }

        /// <summary>
        /// 时间扩展
        /// </summary>
        /// <returns></returns>
        public string CronExpression { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        /// <returns></returns>
        [JsonConverter(typeof(DateTimeJsonConverter))]
        public DateTime? StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        /// <returns></returns>
        [JsonConverter(typeof(DateTimeJsonConverter))]
        public DateTime? EndTime { get; set; }

        /// <summary>
        /// 下次开始时间
        /// </summary>
        /// <returns></returns>
        [JsonConverter(typeof(DateTimeJsonConverter))]
        public DateTime? NextStartTime { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
    }
}